package com.qjsp.util;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.qjsp.action.admin.LoginAction;
import com.qjsp.dao.admin.UserDao;
import com.qjsp.service.admin.UserService;

public class Tests {
	
	@org.junit.Test
	public void testDao() {
		ClassPathXmlApplicationContextTest  ctx = new ClassPathXmlApplicationContextTest();
		ApplicationContext applicationContext = ctx.getApplicationContext();
	UserDao userDao = applicationContext.getBean(UserDao.class);
	
	}
	
	@org.junit.Test
	public void testService() {
		ClassPathXmlApplicationContextTest  ctx = new ClassPathXmlApplicationContextTest();
		ApplicationContext applicationContext = ctx.getApplicationContext();
		UserService userService = applicationContext.getBean("userService",UserService.class);
	System.out.println(userService.selectAll());
	}
	
	/*@Test
	public void testAction() {
		ClassPathXmlApplicationContextTest  ctx = new ClassPathXmlApplicationContextTest();
		ApplicationContext applicationContext = ctx.getApplicationContext();
		LoginAction loginAction = applicationContext.getBean(LoginAction.class);
	loginAction.findName();
	}
	*/

}
